package com.vancouver.knows.ui.activity.my;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.pangu.ui.refresh.ARefreshViewController;
import com.vancouver.knows.R;
import com.vancouver.knows.ui.base.BaseActivity;

import butterknife.Bind;
import butterknife.OnClick;

/**
 * Created by Chris Li on 2016-07-28.
 */
public class MyUserPostCommentsActivity extends BaseActivity {

    private Context mContext;
    @Bind(R.id.text_tips)
    TextView mTextTips;
    @Bind(R.id.my_comment_layout)
    LinearLayout myCommentLayout;
    @SuppressWarnings("rawtypes")
    private ARefreshViewController mController;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.my_comment_activity);
        mContext = MyUserPostCommentsActivity.this;
        setViews();
    }

    private void setViews() {
        Intent intent = getIntent();
        mTextTips.setText(intent.getStringExtra("MY_TITLE"));
        loadView();
    }

    private void loadView() {
        mController = new MyUserPostCommentsPullRefreshView(mContext);
        ((MyUserPostCommentsPullRefreshView) mController).loadData();
        myCommentLayout.addView(mController);
    }

    @OnClick(R.id.cancel)
    public void onCancelClick() {
        finish();
    }

    public void sendEmptyMessage(int what, long delay) {
        super.sendEmptyMessage(what, delay);
    }
}
